let arr=[10,20,30]
// arr.forEach(i=>console.log(i))
// let arr2=new Array()
// arr.forEach(function(item,index,arr){})
Array.prototype.myForEach=function(callback){
    // console.log(this);
    let that=this;
    for(let i=0;i<that.length;i++){
        callback(that[i],i,that)
    }
}
// let arr2=arr.map(i=>i*2)
// console.log(arr20);
Array.prototype.myMap=function(callback){
    let that=this;
    let arr=[]
    for(let i=0;i<that.length;i++){
        arr.push(callback(that[i],i,that))
    }
    return arr;
}
let arr2=arr.map(i=>i*2)
console.log(arr2);
arr.myForEach(i=>console.log(i))